package com.moly.websocketone.websocket;

import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description:  diyigr     stomp 版websocket
 * @Author: m01
 * @Date: created at  2018/11/10  17:14
 * @Modified By:
 */
@Controller
public class SpringSorcketOverStompController {

    @MessageMapping("/v1/chat")//接收信息地址
    @SendTo("/topic/game_chat")//发送信息地址
    public String gameInfo(String  inMessage){

        return inMessage+"  moly";
    }
    @RequestMapping(value = "/websocket/test",method = RequestMethod.GET)
    @ResponseBody
    public String a(){
        return "吧";
    }

}
